Skip to content

fix(sync): preserve synced progress in paused playback - #462

Merged
chhoumann merged 5 commits into
masterfrom
fix/synced-progress-handoff
Oct 13, 2026
Merged

chhoumann merged 5 commits into
masterfrom
fix/synced-progress-handoff

Conversation

@chhoumann

@chhoumann chhoumann commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

A paused player could overwrite newer synced progress with its held position. It now adopts synced progress when this device has not moved it. Active playback and unsaved local seeks, including native media controls, retain priority.

Fixes #461.

Scope

Covers paused progress and local seek ownership through the existing three-way merge. Episode selection and ended-episode restart behavior remain follow-ups.

Verification

  • PASS: npm run lint, npm run format:check, npm run typecheck, npm run build, npm run test (2,424 tests), npm run test:tooling (13 tests), npm run docs:build.
  • PASS: npm run test:e2e on fresh isolated vaults, Linux Obsidian 1.14.4 and 1.13.7, 139 tests each. Node v22.23.2; minimum-version run set PODNOTES_OBSIDIAN_APP=/opt/Obsidian/obsidian.
  • Real 60-second Fixtures/Local Fixture.wav handoff: master saved 12.077712 after sync delivered 45; this branch retained 45. Visible seek saved 30, native seek saved 42, and immediate native seek/save worked before media events. Full player, mini player and Media Session agree. Mobile platforms were not tested.
  • npm run count:writes: master and branch both wrote 0 while idle, 2 after playback/pause, 3 after seek/flush. npm run size: 98,239 -> 98,324 gzip bytes (+85), below 100,000; 311,744 raw bytes.
  • Commands, URI, red/green results and runtime report; raw evidence. One Claude/GPT interrogate pass found the native-seek regression, now fixed and independently verified.
Master after save Fix after save
Master shows 12 seconds Fix retains 45 seconds

Mini player after sync

Release impact

No settings or data format changes, migration, public API changes, or URI changes.

Docs at release

In held #458, sync.md, "Use PodNotes on two devices": remove step 2's stopped-time note and step 5's manual progress-bar correction. Replace the paragraph beginning "Step 5 matters" with the paused adoption rule and priority of active playback or an unsaved local seek. Keep waiting for sync and selecting the desired episode when another episode is loaded.

In "Changes on two devices", replace the claim that every episode played since startup retains its local position with those same rules. In mobile.md, the final "Limits on phones" bullet, remove noting and manually checking the stopped time. Keep pause, wait for sync, and the link to device handoff instructions.

Note

Preserve synced progress in paused playback

  • Fixes PlayerController so a paused player adopts externally synced progress on restore, but a local seek, browser seek, or active playback always wins over a later sync
  • Adds noteStoppedMove helper and stopped-movement detection in onTimeUpdate and persist in PlayerController.ts, so saves skip unchanged paused positions and record changed ones
  • settlePaused now persists the position before publishing the paused state
  • Extensive test coverage: unit tests for seek/sync precedence, persistence integration tests, and new E2E handoff tests in synced-progress-handoff.test.ts covering window hiding, API seeks, and native media seeks
  • Behavioral Change: paused players no longer overwrite a differently-sourced progress record on save; unsignaled browser seeks (currentTime changed before seek events) now take precedence over sync

Macroscope summarized 35d08de.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying podnotes with  Cloudflare Pages  Cloudflare Pages

Latest commit: 35d08de
Status: ✅  Deploy successful!
Preview URL: https://3ccce4ee.podnotes.pages.dev
Branch Preview URL: https://fix-synced-progress-handoff.podnotes.pages.dev

View logs

@chhoumann
chhoumann merged commit f295af1 into master Oct 13, 2026
18 checks passed
@chhoumann
chhoumann deleted the fix/synced-progress-handoff branch October 13, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A paused episode overwrites newer progress synced from another device

1 participant